package nf;

import nf.graph.Graph;
import nf.graph.Delta;

/**
 * Represents some game that is played out over a social network.
 */
public abstract class Game
{
	/**
	 * Executes one turn of the game on the given network.
	 * @param network the social network for which one turn should be executed
	 * @return true if the network has reached an equilibrium, and further steps
	 * will not make any changes unless the network is changed externally;
	 * false if the game network is not at equilibrium
	 */
	public abstract boolean runStep(Graph network);
	
	/**
	 * Executes turns on the network until it reaches equilibrium.
	 * @param network the social network for which one turn should be executed
	 */
	public void run(Graph network)
	{
		while (true) {
			if (!runStep(network))
				return;
		}
	}
}
